-
Notifications
You must be signed in to change notification settings - Fork 35
Add support for an external interpreter #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for an external interpreter #346
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
fe324fa to
95bd490
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #346 +/- ##
==========================================
+ Coverage 74.43% 74.45% +0.01%
==========================================
Files 8 8
Lines 3204 3206 +2
==========================================
+ Hits 2385 2387 +2
Misses 819 819
... and 1 file with indirect coverage changes
|
| void UseExternalInterpreter(TInterp_t I) { | ||
| assert(sInterpreter && "sInterpreter already in use!"); | ||
| sInterpreter = static_cast<compat::Interpreter*>(I); | ||
| OwningSInterpreter = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write a test for this?
417bcd7 to
002ba81
Compare
|
|
||
| EXPECT_NE(ExtInterp, nullptr); | ||
| Cpp::UseExternalInterpreter(ExtInterp); | ||
| EXPECT_FALSE(Cpp::OwnsInterpreter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this probably. We can delete ExtInterp and write a death test.
fcfab29 to
9725d94
Compare
9725d94 to
2df347c
Compare
2df347c to
13669e1
Compare
The new interface can be called by an external library like ROOT, that manages it's own `TInterpreter` instance. In this case the `cling::Interpreter*` initialised by TCling is passed to InterOp and a flag indicates that InterOp does not have ownership
13669e1 to
4dd1e41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The new interface can be called by an external library like ROOT, that manages it's own
TInterpreterinstance. In this case thecling::Interpreter*initialized by TCling is passed to InterOp and a flag indicates that InterOp does not have ownership